﻿#region Copyright Notice
// 
// 
//  
//  Copyright (c) 2009-2011 Anindya Chatterjee
//  
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//  
//      http://www.apache.org/licenses/LICENSE-2.0
//  
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
// 
// 
#endregion
using System;

namespace AbstractClass.NPerf.Framework
{
    /// <summary>
    /// Instructs the NPerf test runner to ignore the method during test run. 
    /// Ignored tests result in a warning message when the tests are run.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method, AllowMultiple = false)]
    public sealed class PerfTestIgnoreAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PerfTestIgnoreAttribute"/> class.
        /// </summary>
        /// <param name="message">The warning message specifying the reason for being ignored.</param>
        /// <example>
        /// <code>
        /// 
        /// [PerfTestIgnore("Test Method Not Implemented")]
        /// public void TestMethod()
        /// {
        ///     // test code yet to be written.
        /// }
        /// 
        /// </code>
        /// </example>
        public PerfTestIgnoreAttribute(string message)
        {
            if (message == null)
                throw new ArgumentNullException("message");
            Message = message;
        }

        /// <summary>
        /// Gets ignore warning message.
        /// </summary>
        /// <value>The message specifying the reason for being ignored.</value>
        public string Message { get; private set; }
    }
}